#include "progressbar.h"
#include <stdio.h>
#include <unistd.h>
double total = 1024.0;
double speed = 1.0;

void downLoad()
{
    double current = 0;
    while(current <= total)
    {
        progressbar2(total,current);
        fflush(stdout);
        current += speed;
        usleep(3000);
    }
    printf("\nComplete !\n");
    printf("DownLoad %fMB\n",total);
}


int main()
{
    downLoad();
    downLoad();
    downLoad();
    downLoad();
    downLoad();
    downLoad();
    downLoad();
    downLoad();
    downLoad();
    downLoad();
    downLoad();
    downLoad();

    //progressbar1();
    return 0;
}
